#ifndef PHYSICALDEVICE_H
#define PHYSICALDEVICE_H


#include "ListOfFunctions.h"
#include "ErkangStruct.h"
#include "Device.h"

#include <vector>
#include <map>
#include <string>


namespace ErkangShuttle
{
	struct DeviceStructPhysicalDevice
	{
		Device* _pDevice{ nullptr };
		DeviceStruct _DeviceStruct;
	};
	class PhysicalDevice
	{
	public:
		PhysicalDevice() = delete;
		PhysicalDevice(PhysicalDeviceStruct*);
		void init();
		Device& createDevice(const std::string&, const std::vector<const char*>&, const std::vector<QueueInfo>&);
		Device& getDevice(const std::string&);
		Device& operator[](const std::string&);
		void destroyDevice(const std::string&);
		std::vector<const char*>& getAllAvailableDeviceExtensions();
	private:
		bool GetAllDeviceExtensionProperties();
		bool GetPhysicalDeviceFeaturesProperties();
		bool GetPhysicalDeviceQueueFamilyProperties();
		
		ListOfPhysicalDeviceFunctions& m_ListOfPhysicalDeviceFunctions;
		VkPhysicalDevice& m_VkPhysicalDevice;
		std::vector<VkExtensionProperties>& m_VkPhysicalDeviceExtensions;
		std::vector<const char*>& m_VkPhysicalDeviceExtensionNames;
		VkPhysicalDeviceFeatures& m_VkPhysicalDeviceFeatures;
		VkPhysicalDeviceProperties& m_VkPhysicalDeviceProperties;
		std::vector<VkQueueFamilyProperties>& m_VkQueueFamilies;

		std::map<std::string, DeviceStructPhysicalDevice*> m_DeviceStructPhysiclDevice;
	};
}

#endif // PHYSICALDEVICE_H
